using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class follow_up_viewMap : EntityTypeConfiguration<follow_up_view>
    {
        public follow_up_viewMap()
        {
            // Primary Key
            this.HasKey(t => new { t.bp_level_seq, t.source_id, t.amount });

            // Properties
            this.Property(t => t.drug_compliance)
                .HasMaxLength(1);

            this.Property(t => t.is_bp_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_bmi_normal)
                .HasMaxLength(1);

            this.Property(t => t.is_belly_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_hdl_c_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_ldl_c_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_tg_3_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_total_cholesterin_aim)
                .HasMaxLength(1);

            this.Property(t => t.is_smoke_aim)
                .HasMaxLength(1);

            this.Property(t => t.follow_up_id)
                .HasMaxLength(101);

            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.follow_up_type)
                .HasMaxLength(20);

            this.Property(t => t.follow_up_type_en)
                .HasMaxLength(20);

            this.Property(t => t.smoke_status)
                .HasMaxLength(50);

            this.Property(t => t.score_desc_cn)
                .HasMaxLength(50);

            this.Property(t => t.score_desc_en)
                .HasMaxLength(50);

            this.Property(t => t.need_transfer_reason_1)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_2)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_3)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_4)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_5)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_6)
                .HasMaxLength(1);

            this.Property(t => t.need_transfer_reason_other)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_1)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_2)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_3)
                .HasMaxLength(1);

            this.Property(t => t.can_not_transfer_other)
                .HasMaxLength(1);

            this.Property(t => t.bp_level_seq)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.bp_level_cn)
                .HasMaxLength(50);

            this.Property(t => t.bp_level_en)
                .HasMaxLength(20);

            this.Property(t => t.source_id)
                .IsRequired()
                .HasMaxLength(5);

            this.Property(t => t.amount)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("follow_up_view");
            this.Property(t => t.drug_compliance).HasColumnName("drug_compliance");
            this.Property(t => t.is_bp_aim).HasColumnName("is_bp_aim");
            this.Property(t => t.is_bmi_normal).HasColumnName("is_bmi_normal");
            this.Property(t => t.is_belly_aim).HasColumnName("is_belly_aim");
            this.Property(t => t.is_hdl_c_aim).HasColumnName("is_hdl_c_aim");
            this.Property(t => t.is_ldl_c_aim).HasColumnName("is_ldl_c_aim");
            this.Property(t => t.is_tg_3_aim).HasColumnName("is_tg_3_aim");
            this.Property(t => t.is_total_cholesterin_aim).HasColumnName("is_total_cholesterin_aim");
            this.Property(t => t.is_smoke_aim).HasColumnName("is_smoke_aim");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_date).HasColumnName("follow_up_date");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.follow_up_sequence).HasColumnName("follow_up_sequence");
            this.Property(t => t.follow_up_flag).HasColumnName("follow_up_flag");
            this.Property(t => t.height).HasColumnName("height");
            this.Property(t => t.weight).HasColumnName("weight");
            this.Property(t => t.heart_ratio).HasColumnName("heart_ratio");
            this.Property(t => t.blood_tg_3).HasColumnName("blood_tg_3");
            this.Property(t => t.follow_up_type).HasColumnName("follow_up_type");
            this.Property(t => t.follow_up_type_en).HasColumnName("follow_up_type_en");
            this.Property(t => t.smoke_status).HasColumnName("smoke_status");
            this.Property(t => t.smoke_number).HasColumnName("smoke_number");
            this.Property(t => t.bmi).HasColumnName("bmi");
            this.Property(t => t.belly_perimeter).HasColumnName("belly_perimeter");
            this.Property(t => t.sbp_final).HasColumnName("sbp_final");
            this.Property(t => t.dbp_final).HasColumnName("dbp_final");
            this.Property(t => t.hdl_c).HasColumnName("hdl_c");
            this.Property(t => t.ldl_c).HasColumnName("ldl_c");
            this.Property(t => t.total_cholesterin).HasColumnName("total_cholesterin");
            this.Property(t => t.chd_risk).HasColumnName("chd_risk");
            this.Property(t => t.framingham_score_id).HasColumnName("framingham_score_id");
            this.Property(t => t.score_desc_cn).HasColumnName("score_desc_cn");
            this.Property(t => t.score_desc_en).HasColumnName("score_desc_en");
            this.Property(t => t.is_need_transfer).HasColumnName("is_need_transfer");
            this.Property(t => t.need_transfer_reason_1).HasColumnName("need_transfer_reason_1");
            this.Property(t => t.need_transfer_reason_2).HasColumnName("need_transfer_reason_2");
            this.Property(t => t.need_transfer_reason_3).HasColumnName("need_transfer_reason_3");
            this.Property(t => t.need_transfer_reason_4).HasColumnName("need_transfer_reason_4");
            this.Property(t => t.need_transfer_reason_5).HasColumnName("need_transfer_reason_5");
            this.Property(t => t.need_transfer_reason_6).HasColumnName("need_transfer_reason_6");
            this.Property(t => t.need_transfer_reason_other).HasColumnName("need_transfer_reason_other");
            this.Property(t => t.can_not_transfer_1).HasColumnName("can_not_transfer_1");
            this.Property(t => t.can_not_transfer_2).HasColumnName("can_not_transfer_2");
            this.Property(t => t.can_not_transfer_3).HasColumnName("can_not_transfer_3");
            this.Property(t => t.can_not_transfer_other).HasColumnName("can_not_transfer_other");
            this.Property(t => t.bp_level_seq).HasColumnName("bp_level_seq");
            this.Property(t => t.bp_level_cn).HasColumnName("bp_level_cn");
            this.Property(t => t.bp_level_en).HasColumnName("bp_level_en");
            this.Property(t => t.source_id).HasColumnName("source_id");
            this.Property(t => t.amount).HasColumnName("amount");
            this.Property(t => t.follow_up_month).HasColumnName("follow_up_month");
        }
    }
}
